﻿using System;
using System.Windows;

namespace CodeCounsel.SharePoint.RibbonDesigner.View.AttachedBehaviors
{
    abstract class DropManager
    {
        public FrameworkElement TargetItemContainer { get; set; }
        public IDropProcessor DropProcessor { get; private set; }

        protected DropManager(IDropProcessor dropProcessor)
        {
            if (dropProcessor == null)
            {
                throw new ArgumentNullException("dropProcessor");
            }
            DropProcessor = dropProcessor;
        }

        public bool CanDrop(object draggedItem)
        {
            return DropProcessor.CanDrop(draggedItem);
        }

        public abstract DragDropEffects DecideDropTarget(DependencyObject originalSource, Func<IInputElement, Point> getDropPoint);
        public abstract void CreateInsertionAdorner();
        public abstract void UpdateInsertionAdornerPosition();
        public abstract void RemoveInsertionAdorner();
        public abstract void InsertDraggedItem(object draggedItem, DragManager sourceHelper, bool move, int originalIndex);
    }
}
